package com.ai.module.user.mapper;

import com.ai.module.user.domain.entity.UserConfigEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface UserConfigMapper extends BaseMapper<UserConfigEntity> {

    @Update("update user_config set points = points- #{costPoints} where user_id =#{userId} and points >0")
    int updateUser(@Param("userId") String userId,@Param("costPoints") int costPoints);

}
